<script setup lang="ts">
import { reactive } from "vue";
import { scanLocalDir, ScanOption } from "@/views/domain/assets/api/scan";

const emit = defineEmits(["scan"]);
const scanOpt = reactive<ScanOption>({
  dir: "/Users/mark/Downloads",
  excludeDirs: [],
  exts: [],
  ignoreHidden: true
});

const onScan = () => {
  emit("scan", scanOpt);

  scanLocalDir(scanOpt).then(res => {
    console.log(res);
  });
};
</script>

<template>
  <div>
    <el-button type="primary" @click="onScan">扫描</el-button>
  </div>
</template>
<style lang="scss" scoped></style>
